package com.cx.purchase.config;

public enum Status {
    QIYONG("启用",1),JINYONG("禁用",0);
    private String statusName;
    private Integer status;

    Status(String statusName, Integer status){
        this.status = status;
        this.statusName = statusName;
    }
    public String getStatusName(){
        return statusName;
    }
    public Integer getStatus(){
        return status;
    }

    public static String getStatusName(Integer status){
        for (Status c : Status.values()) {
            if (status==c.getStatus()){
                return c.getStatusName();
            }
        }
        return null;
    }
    public static Integer getStatus(String statusName){
        for (Status c : Status.values()) {
            if (statusName.equals(c.getStatusName())){
                return c.getStatus();
            }
        }
        return null;
    }
}
